package middleware

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"time"
)

func Logger() gin.HandlerFunc {
	return func(c *gin.Context) {
		host := c.Request.Host
		url := c.Request.URL
		method := c.Request.Method
		fmt.Printf("%s::%s \t %s \t %s \t", time.Now().Format("0000-00-00 00:00:00"), host, url, method)
		c.Next()
		fmt.Println(c.Writer.Status())
	}
}
